package com.example.deviceinfo;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.widget.Toast;

public class BootCompletedReceiver extends BroadcastReceiver {

    public static final String BOOT_COMPLETED_ACTION = "android.intent.action.BOOT_COMPLETED";
    public static final String QUICK_RESUME_ACTION = "com.skyworth.broadcast.standby.quick.resume";

    @Override
    public void onReceive(Context context, Intent intent) {
        // TODO Auto-generated method stub
        Log.d("entry", "BootUpReceiver Action:" + intent.getAction());
        Toast.makeText(context, "BootUpReceiver Action:" + intent.getAction(), Toast.LENGTH_SHORT).show();
        if (intent.getAction().equals(BOOT_COMPLETED_ACTION)
                || intent.getAction().equals(QUICK_RESUME_ACTION)) {
            Intent ootStartIntent = new Intent(context, MainActivity.class);
            ootStartIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(ootStartIntent);
        }
    }
}
